class CreateMembers < ActiveRecord::Migration
  def self.up
    create_table :members do |t|
      t.integer :artist_id, :null => false
      t.integer :band_id, :null => false
      t.integer :joindate_day
      t.integer :joindate_month
      t.integer :joindate_year
      t.integer :leftdate_day
      t.integer :leftdate_month
      t.integer :leftdate_year
      t.integer :role
    end

    add_foreign_key(:members, :artists, :column => :artist_id)
    add_foreign_key(:members, :artists, :column => :band_id)
  end

  def self.down
    drop_table :members
  end
end
